/**
 * This class is NOT in use at all.
 */

package com.bensonbasement.snorflux.server.world.prototypes;

import org.python.core.Py;
import org.python.core.PyBoolean;
import org.python.core.PyException;
import org.python.core.PyObject;
import org.python.core.PyString;

import com.bensonbasement.snorflux.jythonsupport.FlexPyObject;

public class Prototype extends FlexPyObject {
	
	private Prototype parent;
	
	public Prototype(Prototype parent) {
		this.parent = parent;
	}
	
	@Override
	public PyObject __findattr_ex__(String name) {
		PyObject retVal;
		try {
			retVal = super.__findattr_ex__(name);
		}
		catch (PyException ex) {
			if (ex.type == Py.AttributeError || ex.type == Py.TypeError) {
				retVal = null;
			}
			else {
				throw ex;
			}
		}
		if (retVal == null && this.parent != null) {
			retVal = this.parent.__findattr__(name);
		}
		return retVal;
	}
}
